# cmake_minimum_required(VERSION 3.10)
# project(testLib)
# set(CMAKE_CXX_STANDARD 11)

# # 指定头文件搜索路径
# include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
# # 指定源文件
# file(GLOB SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cc)
# # 链接静态库
# link_libraries(mylib)
# # 指定库路径
# link_directories(${CMAKE_CURRENT_SOURCE_DIR}/mylib)
# # 生成可执行程序
# add_executable(testLib ${SRC})


cmake_minimum_required(VERSION 3.10)
project(testLib)
set(CMAKE_CXX_STANDARD 11)

#指定头文件搜索路径
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
#指定源文件
file(GLOB SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cc)
#指定库路径
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/mylib)
#生成可执行程序
add_executable(testLib ${SRC})
#最后链接动态库
# target_link_libraries(testLib libmylib.a)
target_link_libraries(testLib libmylib.so)
